from django.conf.urls import url
from . import views

urlpatterns = [

    url(r'^init.html', views.init_books),
    url(r'home', views.home_page),
    url(r'^add', views.add_book),
    url(r'list', views.list_books, name='list_book'),
    url(r'update/(\d+)', views.update),
    url(r'delete/(\d+)', views.delete),
    url(r'filter_book', views.filter_books),
    url(r'^author/marry$', views.author_marry),
    url(r'^wife/(\d+)', views.query_wife_husband),
    url(r'^author/(\d+)', views.query_author_wife),
    # 图书出版社一对多数据初始化
    url(r'book/init', views.create_book_by_sys),
    # 通过图书找到出版社信息
    url(r'book/(\d+)', views.get_book),
    # 通过出版社获取图书信息
    url(r'publisher/(\d+)', views.list_book),
    # 图书和作者多对多初始化
    url(r'book/many_author_init', views.book_author_many_init),
    url(r'book/show_many2many', views.show_many2many),
    url(r'', views.home_page),
]
